<template>
	<view class="height-screen bg-white">
		<cu-custom isBack bgColor="bg-white">
			<block slot="content">{{title}}</block>
		</cu-custom>
		<view style="margin: 20rpx 25rpx 0;color: #000;">
			<u-parse :content="content"></u-parse>
		</view>
	</view>
</template>

<script>
	import {
		yonghuxieyi,
		yinsixieyi
	} from '@/apis'
	export default {
		data() {
			return {
				title: '',
				content: ''
			}
		},
		onLoad(options) {
			switch (options.type) {
				case 'user':
					this.title = this.$t('xieyi.user')
					this.yonghuxieyi()
					break
				case 'yinsi':
					this.title = this.$t('xieyi.yinsi')
					this.yinsixieyi()
					break
			}
		},
		methods: {
			async yonghuxieyi() {
				const res = await yonghuxieyi()
				this.content = res
			},
			async yinsixieyi() {
				const res = await yinsixieyi()
				this.content = res
			}
		}
	}
</script>